package com.arm.base;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;

import com.arm.utils.ActivityPageManager;
import com.arm.utils.StatusBarUtil;

public abstract class BaseActivity extends AppCompatActivity {

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        ActivityPageManager.getInstance().addActivity(this);
        StatusBarUtil.immersive(this);
        setContentView(getLayoutId());
        initViews();
        initClick();
        initData();

    }
    //获取布局id
    public abstract  int getLayoutId();
    //初始化view
    public abstract void initViews();

    //初始化数据
     public  abstract  void initData();
    //点击事件
    public abstract void initClick();



    @Override
    protected void onDestroy() {
        super.onDestroy();
        ActivityPageManager.getInstance().removeActivity(this);
    }
}
